-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch UnicodeDecodeError
in lobster-json
#103
Conversation
data = get_item(root = data, | ||
path = options.test_list, | ||
required = True) | ||
except UnicodeDecodeError as decode_error: | ||
print("%s: File is not encoded in utf-8: %s" % (file_name, decode_error)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I observed that the old string formatting method is used rather than f-strings, is there any specific reason due to which it is preferred?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there is no particular reason. I just used it because it is used everywhere else, to stay consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something we should address in the coding guideline #88
The `UnicodeDecodeError` is catched, and an error message is printed. Afterwards `lobster-json` exits. Issue: #102
The
UnicodeDecodeError
is catched, and an error message is printed.Afterwards
lobster-json
exits.Issue: #102